diff options
Diffstat (limited to 'src/pages/sujet/[slug].tsx')
| -rw-r--r-- | src/pages/sujet/[slug].tsx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/pages/sujet/[slug].tsx b/src/pages/sujet/[slug].tsx index af78185..8f46677 100644 --- a/src/pages/sujet/[slug].tsx +++ b/src/pages/sujet/[slug].tsx @@ -1,6 +1,7 @@ /* eslint-disable max-statements */ import type { ParsedUrlQuery } from 'querystring'; import type { GetStaticPaths, GetStaticProps } from 'next'; +import dynamic from 'next/dynamic'; import Head from 'next/head'; import NextImage from 'next/image'; import { useRouter } from 'next/router'; @@ -15,7 +16,6 @@ import { PageSidebar, PageBody, LoadingPage, - TocWidget, Spinner, } from '../../components'; import { @@ -49,6 +49,13 @@ import { useTopicsList, } from '../../utils/hooks'; +const Toc = dynamic( + async () => import('../../components').then((mod) => mod.TocWidget), + { + ssr: false, + } +); + export type TopicPageProps = { data: { currentTopic: WPTopic; @@ -169,7 +176,7 @@ const TopicPage: NextPageWithLayout<TopicPageProps> = ({ data }) => { }} /> <PageSidebar> - <TocWidget + <Toc heading={<Heading level={2}>{messages.widgets.tocTitle}</Heading>} tree={[ ...tree, |
